<!doctype html>
<html>
	<head>
		<script>
			var losuj = function()
			{
				var a=document.getElementById("x");
				
				window.setTimeout(function(){
					a.innerHTML="3";
				},1000);
				
				window.setTimeout(function(){
					a.innerHTML="2";
				},1500);
				
				window.setTimeout(function(){
					a.innerHTML="1";
				},2000);
				
				window.setTimeout(function(){
					a.innerHTML="<img src='kostka" + (parseInt(Math.random()*100)%6 + 1) + ".png' />";
				},2500);	
			};
		</script>
		<meta charset="UTF-8">
		<title>Kostka do gry by Bruno & Mati</title>
	</head>
	<body>
		<button onclick="losuj()">Rzuć kostką</button>
		<button onclick="losuj()">Rzuć kostką</button>
		<button onclick="losuj()">Rzuć kostką</button>
		<button onclick="losuj()">Rzuć kostką</button>
		<div id="x">Losuje</div>
	</body>
</html>
